
Partial Class WithCode_VB
    Inherits System.Web.UI.Page

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Dim userNameRequired As RequiredFieldValidator = CType(Login1.FindControl("UserNameRequired"), RequiredFieldValidator)
    Dim passwordRequired As RequiredFieldValidator = CType(Login1.FindControl("PasswordRequired"), RequiredFieldValidator)

    reqUserName.TargetControlID = userNameRequired.UniqueID
    reqPassword.TargetControlID = passwordRequired.UniqueID

    userNameRequired.Display = ValidatorDisplay.None
    passwordRequired.Display = ValidatorDisplay.None

  End Sub
End Class
